package com.xzjie.web.common.dao;

import java.util.HashSet;
import java.util.Set;
import com.xzjie.web.common.model.Permission;
import com.xzjie.web.common.model.Role;
import com.xzjie.web.common.model.User;

/**
 * Created by michael on 14-7-5.
 */
public class UserDao {

	public User findByName(String name) {
		// mock user
		User user = new User();
		user.setId(1l);
		user.setName("michael");
		user.setPassword("phN4savQMoWQ+uPP35GjOg==");// 000000
		user.setSalt("123");
		Set<Role> roleSet = new HashSet<Role>();
		Role role = new Role(1l, "admin");
		role.setPermissionList(Permission.getValueList());
		roleSet.add(role);
		user.setRoleSet(roleSet);
		return user;
	}

}
